<?php
/**
 * 系統名稱: Lotto 系統
 * 檔案說明: 專案管理-修改
 * $Author$
 * $Id$
 *
 */

$strBT = trim($_data["Bet_Type"]);
$intGambleID = (int)$_data["GambleID"];
$isStopBet = (int)$_data["isStopBet"];
$isSpecial = (int)$_data["isSpecial"];
$strLottoNumber = trim($_data["strLottoNumber"]);
$intLType = (int)$arrLotto["LType"];

if($strBT == "" || $intGambleID < 1 || $intLType <= 0){
	$GLOBALS["errormessage"] = "Data Error!!";
	$GLOBALS["errorhidden"] = "\nBetType:".$strBT."\nGambleID:".$intGambleID."\nLottoID:".$intLID."\nLine:".__LINE__."\nPage:".__FILE__;
	ErrMsgOutputHTML("Error", "", 1);
}

PMA_mysql_query("BEGIN", $_ConnMaster);
if(preg_match("/,/", $strBT) || $strLottoNumber == ""){
	if(!StopAllBetTodayGame($intGambleID, $intLID, $strBT, $intLType, $isStopBet, $strLottoNumber)){
		PMA_mysql_query("ROLLBACK", $_ConnMaster);
		ErrMsgOutputHTML("Error", "", 1);
	}
}else{
	if(!StopBetTodayGame($intGambleID, $intLID, $strBT, $intLType, $isStopBet, $strLottoNumber)){
		PMA_mysql_query("ROLLBACK", $_ConnMaster);
		ErrMsgOutputHTML("Error", "", 1);
	}
}
PMA_mysql_query("COMMIT", $_ConnMaster);

$strLog = "操盤序號：".$intGambleID."\n";
$strLog .= "下注種類：".$strBT."\n";
$strLog .= "是否停押：".$isStopBet."\n";
$strLog .= "停押號碼：".$strLottoNumber."\n";
AddData_Log($_SESSION["Admin_Info"] -> ID, "停押", $strLog);

if($strBT == "92" || $strBT == "93"){
	/*=================================================================*/
	header("Cache-Control: no-store, no-cache, must-revalidate");	  // HTTP/1.1
	header("Cache-Control: post-check=0, pre-check=0", false);
	header("Pragma: no-cache");															  // HTTP/1.0
	?><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<script language="JavaScript">
	<!--
	parent.ChangeBet(<?php print $strBT;?>);
	//-->
	</script><?php
	exit();
}
if(preg_match("/51.+70.+92/", $strBT))$_data["Bet_Type"] = "51,52,53,54,55,56,57,58,59,60,61,62,63,84,85,86";
?>